<form class="form-horizontal" id="form-add-type">
    <div class="form-group">
        <label class="control-label col-xs-2">
            标题
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title" placeholder="请输入标题"value="{$info.title}" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">公告简介</label>
        <div class="col-xs-9">
            <input type="text" maxlength="30" class="form-control" value="{$info.description}" name="description" placeholder="公告简介">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">
            公告详情
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            {include file="public/ueditor" editor-name="detail" /}
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">排序</label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="ord" value="{$info.display_order}"
                   placeholder="序号越高，显示越靠前">
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-2">是否显示</label>
        <div class="col-xs-9">
            <div class="btn-group" data-toggle="buttons">
                <label class="btn btn-default {if condition='$info.is_visible'}active{/if}">
                    <input type="radio" name="visible" id="visible_1" value="1" {if condition="$info.is_visible"}checked{/if}> 显示
                </label>
                <label class="btn btn-default {if condition='!$info.is_visible'}active{/if}">
                    <input type="radio" name="visible" id="visible_0" value="0" {if condition="!$info.is_visible"}checked{/if}> 隐藏
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <button type="submit" class="btn btn-success btn-block">编辑</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-type").validate({
            messages:
                {
                    title: "请输入标题",
                    detail: "请输入公告详情"
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-type', true);
            }
        });
    })
</script>